package com.acwing.partition34;

import java.io.*;

/**
 * @author `RKC`
 * @date 2022/5/20 8:12
 */
public class AC3359更多奇怪的照片 {

    private static int[] f = new int[2];
    private static int n;

    private static StreamTokenizer tokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    private static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        n = nextInt();
        for (int i = 0; i < n; i++) f[nextInt() & 1]++;
        while (f[1] > f[0]) {
            f[0]++;
            f[1] -= 2;
        }
        if (f[0] == f[1]) writer.println(f[0] + f[1]);
        else writer.println(2 * f[1] + 1);
        writer.flush();
    }

    private static int nextInt() throws IOException {
        tokenizer.nextToken();
        return (int) tokenizer.nval;
    }
}
